{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Making an animated video patched with particle trajectories"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# The usual suspects\n",
    "import numpy as np\n",
    "import scipy as sp    \n",
    "import pandas as pd   \n",
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import cv2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    }
   ],
   "source": [
    "# For plotting\n",
    "import pylab as pl\n",
    "import matplotlib\n",
    "from matplotlib import animation\n",
    "%pylab inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# For patching\n",
    "from matplotlib.patches import Rectangle\n",
    "from matplotlib import cm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "ename": "RuntimeError",
     "evalue": "module compiled against API version 0xc but this version of numpy is 0xa",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mRuntimeError\u001b[0m                              Traceback (most recent call last)",
      "\u001b[0;31mRuntimeError\u001b[0m: module compiled against API version 0xc but this version of numpy is 0xa"
     ]
    },
    {
     "ename": "RuntimeError",
     "evalue": "module compiled against API version 0xc but this version of numpy is 0xa",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mRuntimeError\u001b[0m                              Traceback (most recent call last)",
      "\u001b[0;31mRuntimeError\u001b[0m: module compiled against API version 0xc but this version of numpy is 0xa"
     ]
    }
   ],
   "source": [
    "# For tracking\n",
    "from tracker import tracker"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython.display import HTML"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def inflate(image):\n",
    "    '''\n",
    "    Returns a BW image from a RGB image.\n",
    "    '''\n",
    "    shape = image.shape\n",
    "    new_image = np.zeros([shape[0], shape[1], 3])\n",
    "    new_image[:, :, 0] = image\n",
    "    new_image[:, :, 1] = image\n",
    "    new_image[:, :, 2] = image\n",
    "    return new_image"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Restoring parameters from /home/michael/python/tracker/models/lorenzmie.ckpt\n"
     ]
    }
   ],
   "source": [
    "# Instantiate tracker\n",
    "trk = tracker.tracker()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'folder' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-9-8d8a5bd45a58>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      7\u001b[0m \u001b[0;31m# Open the video.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      8\u001b[0m \u001b[0mname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"example.avi\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 9\u001b[0;31m \u001b[0mfn\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfolder\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     10\u001b[0m \u001b[0mcap\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcv2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mVideoCapture\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     11\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'folder' is not defined"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfoAAAF6CAYAAADxpZqRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAFM5JREFUeJzt3X+w5Xdd3/HXO1lF0BADNonNJoAYiKGxmErCgC234EDAmmTUiYpDK9iWTtqamdqapEqzfzgjm5mqdTA4GSldMTam0hkjps0Pwx2EMZiaBCIJYVFIwtpsSkBBKbIJ7/5xTtLLZvfec+/ec3987uMxc2bO+d7vOffNd8J97vd7vud7qrsDAIzpuM0eAACYH6EHgIEJPQAMTOgBYGBCDwADE3oAGNiuzR5gLarKZwIB2HG6u1b7nG27R9/dbnO+XXXVVZs+w+g329g2HuFmG2/Mba22begBgJUJPQAMTOg5qoWFhc0eYXi28fzZxvNnG29tdSzH/TdLVfV2nBsA1qqq0jvpZDwAYGVCDwADE3oAGJjQA8DAhB4ABib0ADAwoQeAgQk9AAxM6AFgYEIPAAMTegAYmNADwMCEHgAGJvQAMDChB4CBCT0ADEzoAWBgQg8AAxN6ABiY0APAwIQeAAYm9AAwMKEHgIEJPQAMTOgBYGBCDwADE3oAGJjQA8DAhB4ABib0ADAwoQeAgQk9AAxM6AFgYEIPAAMTegAYmNADwMCEHgAGJvQAMDChB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48oI5SY7P5Kx8YE7s0QPAwOzRA8DAhB4ABib0ADAwoQeAgQk9AAxM6AFgYP8PRf5DQ0zas+0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f9d9bf42a90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Make a figure.\n",
    "fig, ax = pl.subplots(figsize=(8,6))\n",
    "ax.set_xlabel('X [pixel]')\n",
    "ax.set_ylabel('Y [pixel]')\n",
    "ax.set_ylim([0, 479])\n",
    "\n",
    "# Open the video.\n",
    "fn = \"example.avi\"\n",
    "cap = cv2.VideoCapture(fn)\n",
    "\n",
    "ret, frame = cap.read()\n",
    "im = ax.imshow(frame, interpolation='none', cmap=pl.get_cmap('gray'))\n",
    "\n",
    "# Begin animation.\n",
    "def init():\n",
    "    ret = False\n",
    "    while ret == False:\n",
    "        ret, frame = cap.read()\n",
    "    im.set_data(frame)\n",
    "    return im,\n",
    "\n",
    "def anim(i):\n",
    "    ret, frame = cap.read()\n",
    "    if ret:\n",
    "        features = trk.predict(frame)\n",
    "        for feature in features:\n",
    "            x, y, w, h = feature\n",
    "            rect = Rectangle(xy=(x - w/2, y - h/2), width=w, height=h, fill=False, linewidth=3, edgecolor='r')\n",
    "            ax.add_patch(rect)\n",
    "        im.set_array(frame)\n",
    "    return im,\n",
    "\n",
    "anim = animation.FuncAnimation(fig, anim, init_func=init, blit=True, interval=50)\n",
    "#anim.save('test_mpl_anim.avi')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Show animation\n",
    "HTML(anim.to_html5_video())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
